<%@page import="es.us.lsi.aws.api.server.dao.DAOSocialAccount"%>
<%@page import="es.us.lsi.aws.api.model.SocialAccount"%>
<%@page import="java.util.List"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="com.google.appengine.api.users.UserService"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Your BufferApp client</title>
</head>
<body>

	<%
		UserService userService = UserServiceFactory.getUserService();
		response.getWriter().println(
				"<p>Hello, " + request.getUserPrincipal().getName());
	%>
	<form name="postMessage" action="/1/messages/buffered" method="post">
		Write a message: <input type="text" name="text"><br>
		Choose when post it: <input type="datetime-local" name="datetime">
		<br> <br> Choose the target social networks: <br>
		<%
			List<SocialAccount> lstSocialAccount = DAOSocialAccount
					.getAllAccounts();
			for (SocialAccount socialAccount : lstSocialAccount) {
		%>
		<input type="checkbox" name="lstSocialAccount"
			value="<%=socialAccount.getSocialNetwork() + ":"
						+ socialAccount.getName()%>"><%=socialAccount.getSocialNetwork() + ": "
						+ socialAccount.getName()%><br>
		<%
			}
		%>
		<input type="submit" value="Post it!">
	</form>

	<br>
	<br>
	<br>

	<form name="addAcc" action="/1/accounts/" method="post">
		Write your twitter/facebook ID: <input type="text" name="name"><br>
		<input type="radio" name="socialNetwork" value="Twitter">Twitter<br>
		<input type="radio" name="socialNetwork" value="Facebook">Facebook<br>
		<input type="submit" value="Add it!">
	</form>
</body>
</html>